//         冯新杰编写JAVA文件
//         编写人：冯新杰
//         时间2022-07-20
import VueRouter from "vue-router";
const routes=[
    {
        path:'/',
        name:'login',
        component:()=>import('../components/Login'),
    },{
        path:'/Index',
        name:'index',
        component:()=>import('../components/Index'),
        children:[{
            path:'/Home',
            name:'home',
            meta:{
                title:'首页'
            },
            component:()=>import('../components/DateUtils')
        }]
    },
]

const router = new VueRouter({
    mode:'history',
    routes
})

export function resetRouter(){
    router.matcher = new VueRouter({
        mode:'history',
        routes:[]
    }).matcher
}
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (to) {
    return VueRouterPush.call(this, to).catch(err => err)
}
export default router;